﻿import getNetWork from '../../libs/getNetWork.js';
import portlet from '../../components/portlet.vue';

export default {
    components:{
        portlet,
    },
    data() {
        return {
            dataObj:{},
            loading1: true
        };
    },

    mounted:function() {

        this.getData();


    },
    methods:{
        getData(){
            let that=this;
            let data={
                url:that.getNetDataAddress+'/merchant/selectById',

                successCallback(res){
                    if(res.body.errorCode=="0000"){
                        // console.log("merchant/selectById",res.body.dataObj);
                        that.dataObj = res.body.dataObj;
                        that.getData1();
                    }

                },
                defaultCallback(){
                    that.loading1=false;
                }
            }
            getNetWork.get(this,data);

        },


        // http://192.168.11.121:8040/pf/merchant_pay_chat/add?merchant_id=1&merchantId=1&merchantCode=1
        // http://192.168.11.121:8040/pf/merchant_pay_chat/selectByPage?merchant_id=1&page=1&rows=10
        // http://192.168.11.121:8040/pf/merchant_pay_chat/update?merchant_id=1&merchantId=2&merchantCode=2&id=1
        getData1(){
            let that=this;
            let data={
                url:that.getNetDataAddress+'/merchant_pay_chat/selectByPage',
                data:{
                    merchant_id:that.dataObj.id
                },
                successCallback(res){
                    if(res.body.errorCode=="0000"){
                        console.log("merchant/selectById",res.body.dataObj);
                        // that.dataObj = res.body.dataObj;
                    }

                },
                defaultCallback(){
                    that.loading1=false;
                }
            }
            getNetWork.post(this,data);

        },

    }
};
